package com.lizhi.yun.db.stand.pojo;

import com.lizhi.mybatis.boot.Description;
import lombok.Data;
import lombok.ToString;

import javax.persistence.*;

/**
 * @Author: lizhi
 * @Description: 处方记录表
 * @Date: create in 2020/6/13 16:53
 */
@Data
@ToString
@Entity
@Table(name = "stand_prescription_action")
@Description("处方列表")
public class StandPrescriptionActionPOJO {

    @Id
    @Column(length = 30)
    @Description("lid")
    public String lid;

    @Column(length = 30)
    @Description("preActionId")
    private String preActionId;

    @Column(length = 30)
    @Description("处方id")
    private String preId;

    @Column(length = 2)
    @Description("治疗方式00-主动运动，01-被动运动")
    private String preActionType;

    @Transient
    @Description("治疗方式")
    private String preActionTypeText;

    @Column
    @Description("运动时长（秒）")
    private Integer preActionTime;

    @Column(length = 200)
    @Description("被动运动左脚速度")
    private String preActionLeftSpeed;

    @Column(length = 200)
    @Description("被动运动右脚速度")
    private String preActionRightSpeed;

    @Column(length = 2)
    @Description("是否含有电刺激：00-没有；01-有")
    private String preActionElectricalStatus;

    @Transient
    @Description("是否含有电刺激")
    private String preActionElectricalStatusText;

    @Column(length = 2)
    @Description("电刺激类型:01-矩形波，02-三角波，03-梯形波，04-锯齿波")
    private String preActionElectrical;

    @Transient
    @Description("电刺激类型")
    private String preActionElectricalText;

    @Column(length = 200)
    @Description("电刺激幅值")
    private String preActionAmplitude;

    @Column(length = 200)
    @Description("痉挛值(1-一级，2-二级，3-三级)")
    private String preActionSpasm;

    @Transient
    @Description("排序号")
    private String name;

    @Column(length = 200)
    @Description("排序号")
    private String preActionSort;

    @Column(length = 500)
    @Description("创建者")
    private String preActionCrtBy;

    @Column(length = 500)
    @Description("更新者")
    private String preActionUpdBy;

    @Column(length = 19)
    @Description("插入时间")
    private String preActionIstTm;

    @Column(length = 19)
    @Description("更新时间")
    private String preActionUpdTm;

    @Column(length = 2)
    @Description("上传状态")
    private String preActionUpState;

    @Column(length = 19)
    @Description("上传时间")
    private String preActionUpTm;

    /*云管需要的数据*/
    @Column(length = 200)
    @Description("医院ID")
    private String hospitalId;

    @Column(length = 200)
    @Description("系统ID")
    private String hospitalSystemId;

    public String getPreActionTypeText() {
        if ("00".equals(this.preActionType)){
            this.preActionTypeText = "主动运动";
        } else if ("01".equals(this.preActionType)){
            this.preActionTypeText = "被动运动";
        }
        return preActionTypeText;
    }

    public String getPreActionElectricalStatusText() {
        if ("00".equals(this.preActionElectricalStatus)){
            this.preActionElectricalStatusText = "否";
        } else if ("01".equals(this.preActionElectricalStatus)){
            this.preActionElectricalStatusText = "是";
        }
        return preActionElectricalStatusText;
    }

    public String getPreActionElectricalText() {
        if ("01".equals(this.preActionElectrical)){
            this.preActionElectricalText = "矩形波";
        } else if ("02".equals(this.preActionElectrical)){
            this.preActionElectricalText = "三角波";
        } else if ("03".equals(this.preActionElectrical)){
            this.preActionElectricalText = "梯形波";
        } else if ("04".equals(this.preActionElectrical)){
            this.preActionElectricalText = "锯齿波";
        }
        return preActionElectricalText;
    }
}
